1. Field of the Invention
The present invention relates to the field of digital video systems. More specifically, the present invention relates to static and dynamic companding performed on these digital video systems.
2. Background
In digital video systems, it is common to find digital video data being shifted/modified from one range to another, for example, from 0-255 to 16-235, or from 0-255 to 1-254. The digital video data may be shifted/modified for a variety of reasons including but not limited to filtering. In the process of shifting/modifying digital data, rounding errors will occur. In the example of shifting/modifying data from 0-255 to 16-235, the 8-bit output data would be computed from the transfer function Data.sub.-- out=Truncated (Data.sub.-- in.times.(219/255)+16). Data.sub.-- out would be 16 for both Data.sub.-- in=0, and Data.sub.-- in=1; Data.sub.-- out would be 22 for both Data.sub.-- in=7 and Data.sub.-- in=8; etc. Very often dynamic companding or rounding will be employed to minimize the impact of rounding errors, a phenomenon which can manifest itself as visual banding. Dynamic companding is a process that varies quantization ranges in order to mask the rounding errors, or visual banding, by rounding up or rounding down based on probability, rather than simply truncating.
However, there is a tradeoff in using dynamic companding to ameliorate the rounding error situation. Random noise is introduced into the video image as a result of rounding up or down based on probability. The additional random noise can reduce the clarity of the image, as an entire frame will have additional noise. Additionally, traditional dynamic companding or rounding approaches are typically uncontrollable. That is, identical dynamic companding, though random within a defined intra-frame area, can not be identically replicated on another similar area. Therefore, the additional random noise also reduces the quality of the image as a result of their inter-frame independence. Thus, it is desirable if the digital video system would dynamically round the digital video data only when necessary (as rounding errors occur horizontally or vertically adjacent to each other). Furthermore, it is desirable if the dynamic companding is controllable within a horizontal line, an intra-frame area or a frame. Then, the rounding error situation can be ameliorated with minimal compromises to the video quality of the video image.
While dynamic companding is often used to minimize the rounding errors, or visual banding, depending on the application, there are times linear or non-linear static companding may be more suitable to ameliorate the rounding error situation. Static companding is a process that varies quantization ranges in order to mask the rounding errors, or visual banding, by rounding up or rounding down based on a predetermined manner. Thus, it is desirable if the digital video system can support multiple linear/non-linear static companding schemes and dynamic companding schemes in an integrated manner.
As will be disclosed, the present invention provides a method and apparatus for selectively performing controllable dynamic companding, and linear/non-linear static companding in a digital video system that achieves the above described desirable results.